home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  4.6 KB  |  204 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1988-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COMMRESOURCES__
  18. #define __COMMRESOURCES__
  19.  
  20. #ifndef __OSUTILS__
  21. #include <OSUtils.h>
  22. #endif
  23. #ifndef __CONDITIONALMACROS__
  24. #include <ConditionalMacros.h>
  25. #endif
  26.  
  27.  
  28.  
  29. #if PRAGMA_ONCE
  30. #pragma once
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT
  38. #pragma import on
  39. #endif
  40.  
  41. #if PRAGMA_STRUCT_ALIGN
  42.     #pragma options align=mac68k
  43. #elif PRAGMA_STRUCT_PACKPUSH
  44.     #pragma pack(push, 2)
  45. #elif PRAGMA_STRUCT_PACK
  46.     #pragma pack(2)
  47. #endif
  48.  
  49.  
  50. enum {
  51.                                                                 /*    tool classes (also the tool file types)    */
  52.     classCM                        = FOUR_CHAR_CODE('cbnd'),
  53.     classFT                        = FOUR_CHAR_CODE('fbnd'),
  54.     classTM                        = FOUR_CHAR_CODE('tbnd')
  55. };
  56.  
  57.  
  58. enum {
  59.                                                                 /*    version of the Comm Resource Manager    */
  60.     curCRMVersion                = 2,                            /* constants general to the use of the Communications Resource Manager */
  61.     crmType                        = 9,                            /* queue type    */
  62.     crmRecVersion                = 1,                            /* version of queue structure */
  63.                                                                 /*    error codes */
  64.     crmGenericError                = -1,
  65.     crmNoErr                    = 0
  66. };
  67.  
  68. /* data structures general to the use of the Communications Resource Manager */
  69. typedef OSErr                             CRMErr;
  70.  
  71. struct CRMRec {
  72.     QElemPtr                         qLink;                        /*reserved*/
  73.     short                             qType;                        /*queue type -- ORD(crmType) = 9*/
  74.     short                             crmVersion;                    /*version of queue element data structure*/
  75.     long                             crmPrivate;                    /*reserved*/
  76.     short                             crmReserved;                /*reserved*/
  77.     long                             crmDeviceType;                /*type of device, assigned by DTS*/
  78.     long                             crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  79.     long                             crmAttributes;                /*pointer to attribute block*/
  80.     long                             crmStatus;                    /*status variable - device specific*/
  81.     long                             crmRefCon;                    /*for device private use*/
  82. };
  83. typedef struct CRMRec                    CRMRec;
  84. typedef CRMRec *                        CRMRecPtr;
  85. EXTERN_API( CRMErr )
  86. InitCRM                            (void);
  87.  
  88. EXTERN_API( QHdrPtr )
  89. CRMGetHeader                    (void);
  90.  
  91. EXTERN_API( void )
  92. CRMInstall                        (CRMRecPtr                 crmReqPtr);
  93.  
  94. EXTERN_API( OSErr )
  95. CRMRemove                        (CRMRecPtr                 crmReqPtr);
  96.  
  97. EXTERN_API( CRMRecPtr )
  98. CRMSearch                        (CRMRecPtr                 crmReqPtr);
  99.  
  100. EXTERN_API( short )
  101. CRMGetCRMVersion                (void);
  102.  
  103. EXTERN_API( Handle )
  104. CRMGetResource                    (ResType                 theType,
  105.                                  short                     theID);
  106.  
  107. EXTERN_API( Handle )
  108. CRMGet1Resource                    (ResType                 theType,
  109.                                  short                     theID);
  110.  
  111. EXTERN_API( Handle )
  112. CRMGetIndResource                (ResType                 theType,
  113.                                  short                     index);
  114.  
  115. EXTERN_API( Handle )
  116. CRMGet1IndResource                (ResType                 theType,
  117.                                  short                     index);
  118.  
  119. EXTERN_API( Handle )
  120. CRMGetNamedResource                (ResType                 theType,
  121.                                  ConstStr255Param         name);
  122.  
  123. EXTERN_API( Handle )
  124. CRMGet1NamedResource            (ResType                 theType,
  125.                                  ConstStr255Param         name);
  126.  
  127. EXTERN_API( void )
  128. CRMReleaseResource                (Handle                 theHandle);
  129.  
  130. EXTERN_API( Handle )
  131. CRMGetToolResource                (short                     procID,
  132.                                  ResType                 theType,
  133.                                  short                     theID);
  134.  
  135. EXTERN_API( Handle )
  136. CRMGetToolNamedResource            (short                     procID,
  137.                                  ResType                 theType,
  138.                                  ConstStr255Param         name);
  139.  
  140. EXTERN_API( void )
  141. CRMReleaseToolResource            (short                     procID,
  142.                                  Handle                 theHandle);
  143.  
  144. EXTERN_API( long )
  145. CRMGetIndex                        (Handle                 theHandle);
  146.  
  147. EXTERN_API( short )
  148. CRMLocalToRealID                (ResType                 bundleType,
  149.                                  short                     toolID,
  150.                                  ResType                 theType,
  151.                                  short                     localID);
  152.  
  153. EXTERN_API( short )
  154. CRMRealToLocalID                (ResType                 bundleType,
  155.                                  short                     toolID,
  156.                                  ResType                 theType,
  157.                                  short                     realID);
  158.  
  159. EXTERN_API( OSErr )
  160. CRMGetIndToolName                (OSType                 bundleType,
  161.                                  short                     index,
  162.                                  Str255                 toolName);
  163.  
  164. EXTERN_API( OSErr )
  165. CRMFindCommunications            (short *                vRefNum,
  166.                                  long *                    dirID);
  167.  
  168. EXTERN_API( Boolean )
  169. CRMIsDriverOpen                    (ConstStr255Param         driverName);
  170.  
  171. EXTERN_API( CRMErr )
  172. CRMParseCAPSResource            (Handle                 theHandle,
  173.                                  ResType                 selector,
  174.                                  unsigned long *        value);
  175.  
  176. EXTERN_API( OSErr )
  177. CRMReserveRF                    (short                     refNum);
  178.  
  179. EXTERN_API( OSErr )
  180. CRMReleaseRF                    (short                     refNum);
  181.  
  182.  
  183.  
  184. #if PRAGMA_STRUCT_ALIGN
  185.     #pragma options align=reset
  186. #elif PRAGMA_STRUCT_PACKPUSH
  187.     #pragma pack(pop)
  188. #elif PRAGMA_STRUCT_PACK
  189.     #pragma pack()
  190. #endif
  191.  
  192. #ifdef PRAGMA_IMPORT_OFF
  193. #pragma import off
  194. #elif PRAGMA_IMPORT
  195. #pragma import reset
  196. #endif
  197.  
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201.  
  202. #endif /* __COMMRESOURCES__ */
  203.  
  204.